package com.briup.estore.service.Impl;

import com.briup.estore.bean.extend.CategoryExtend;
import com.briup.estore.dao.extend.CategoryExtendMapper;
import com.briup.estore.service.CategoryService;
import com.briup.estore.util.MyBatisSqlSessionFactory;
import org.apache.ibatis.session.SqlSession;

import java.io.IOException;
import java.util.List;

public class CategoryServiceImpl implements CategoryService {
    private CategoryExtendMapper categoryExtendMapper;
    {
        try {
            SqlSession sqlSession = MyBatisSqlSessionFactory.openSession();
            categoryExtendMapper = sqlSession.getMapper(CategoryExtendMapper.class);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    @Override
    public List<CategoryExtend> selectAll() {
        return categoryExtendMapper.selectAll();
    }
}
